<%@ include file="/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>
			<decorator:title default="Welcome" /> | <fmt:message key="webapp.name" />
		</title>
		<meta http-equiv="Cache-Control" content="no-store" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="shortcut icon" href="${ctx}/images/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" type="text/css" href="${ctx}/styles/jawashop.css" />
		<script type="text/javascript" src="${ctx}/scripts/ae.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/aisn.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/home.js"></script>
		<decorator:head />
	</head>
	<body>
		<div id="page">
			<div id="header">
				<div class="header960">
					<div class="utility">
						<c:if test="${empty pageContext.request.remoteUser}">
							<ul class="right">
								<li class="right">
									<strong style="margin: 0pt 5px 0pt 0pt; color: rgb(102, 102, 102);">Welcome to jawashop!</strong>
									<a href="/regist.html"><fmt:message key="user.join" /></a> | 
									<a href="/login.jsp"><fmt:message key="user.login" /></a>
								</li>
							</ul>
						</c:if>
						<c:if test="${!empty pageContext.request.remoteUser}">
							<ul class="right">
								<li class="right">
									<strong style="margin: 0pt 5px 0pt 0pt; color: rgb(102, 102, 102);">${pageContext.request.remoteUser}:Welcome to jawashop!</strong>
									<a href="/logout.jsp"><fmt:message key="user.logout"/></a>
								</li>
							</ul>
						</c:if>
						<script type="text/javascript">
							try {
								var translation = new AE.widget.translation;
								translation.init();
							} catch (e) {
							}
						</script>
						<iframe style="display: none; z-index: 9; top: 0px; left: 0px;"
							class="maskIframe" frameborder="0">
						</iframe>
					</div>
				
					<div id="aliLogo">
						<a href="">
							<img src="/images/login_logo.gif" alt="Manufacturers" align="left" border="0">
						</a>
					</div>
					
					<div id="mainNav">
						<ul>
							<li><a href="" title="Buy Now">Buy Now</a></li>
							<li><a href="" title="Sell Now">Sell Now</a></li>
							<li class="myAlibaba">
								<a href="" id="overShowMyAlibaba">My Alibaba</a>
								<ul id="overShowMyAlibabaContent" style="display: none;">
									<li class="line">
										<a href="">Message Center</a>
									</li>
									<li>
										<a href="">Display Products</a>
									</li>
									<li class="line">
										<a href="">Post Buying Leads</a>
									</li>
									<li>
										<a href="">Join New Promotions</a>
									</li>
								</ul>
								<iframe style="display: none; z-index: 99; top: 0px; left: 0px;"
									class="maskIframe" frameborder="0">
								</iframe>
							</li>
							<li><a href="">Community</a></li>
							<li>
								<a href=""
									title="News on Alibaba.com - Business, Finance, Industry, Trade">News</a>
							</li>
							<li id="india3" style="display: none;">
								<a href=""	title="India Trade">India Trade</a>
							</li>
							<li id="chinese7" style="">
								<a href="" target="_blank">
									<img src="${ctx}/images/jawashop/home_china_site.gif" alt="Alibaba China" border="0">
								</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<script>
				(function (){
					AE.fix.imageLoader('${ctx}/images/jawashop/subNavBg.gif');
				    var overkShowConfig = {
				    targetId:"overShowMyAlibaba",
				    contentId:"overShowMyAlibabaContent",
				    needMask:true,
				    showDelayTime:200,
				    hiddenDelayTime:200,
				    excursion:[0,18]
				    };
				    var overkShowInstance = new AE.widget.overShow();
				    overkShowInstance.init(overkShowConfig); 
				})();	
			</script>
		
			<div id="page960" class="frameA">
			
				<script language="javascript">try{document.domain="alibaba.com";}catch(E){}</script>
				<script language="javascript">
				   	 var withinActionUrl = '';
					 	 var withinResult = false;
					 	 function beforeSubmit(SearchForm){
					 var oFormIndexArea = get("IndexAreaOptionIdx");	
						var sv = oFormIndexArea.options[oFormIndexArea.selectedIndex].value;
					 			  	if(trim(SearchForm.SearchText.value) == '' && sv != 'ts_en'){
					    	alert('Please input a search term.');
					    	SearchForm.SearchText.focus();
					    	return false;
					  	}
					  	if(isMatchTitle(SearchForm.SearchText.value)){
					    	SearchForm.SearchText.value = '';
					    	YUD.setStyle(SearchForm.SearchText, 'color', '#000');
					    	alert('Please input a search term.');
					    	SearchForm.SearchText.focus();
					    	return false;
					  	}
					  	if(SearchForm.SearchText.value.length>50){
					  		alert('please input a search term less than 50 characters.');
					  		SearchForm.SearchText.focus();
					  		return false;
					  	}
						if(sv=='ts_en' && get('srchLocationIdx').value.isEmpty() && get('srchIndustryIdx').value.isEmpty() && SearchForm.SearchText.value.trim().isEmpty()){
								alert('Please select at least one condition.');
								return false;
							}
				
				      	if(SearchForm.IndexArea.tagName.toUpperCase() == 'SELECT'){							
					    	var selectedText = SearchForm.IndexArea.options[SearchForm.IndexArea.selectedIndex].text;
							var selectedValue = SearchForm.IndexArea.options[SearchForm.IndexArea.selectedIndex].value;
							var actionUrl = "";
				
							SearchForm.Type.value = "";			
							
				        	if(selectedText == 'Buying Leads'){
					      		SearchForm.Type.value = "BUY";
								actionUrl = "http://importer.alibaba.com/buyeroffers";
					    	} 
							else if(selectedText == 'Selling Leads'){ 
				    	      	SearchForm.Type.value = "SALE,AGENT,MISC";
								actionUrl = "http://www.alibaba.com/trade/search";
				    	    } 
							else if(selectedValue == 'ts_en'){
								actionUrl = "http://tradeshow.alibaba.com/search";
								tradeShowSearch();
							}
							else {
								actionUrl = "http://www.alibaba.com/trade/search";
				    	    }
							SearchForm.action = actionUrl
					  	}
						
					  	if(withinResult && withinActionUrl != ''){ SearchForm.action = withinActionUrl; }
						if(check(SearchForm.SearchText.value)){
							alert('Sorry, the information you filled in is not in English. Please input the information in English instead.');
							return false;
						}
						//SearchForm.submit();
					  	return true;
					 }
					 
					function check(str){   
							for(i=0;i<str.length;i++){   
					    	if(str.charCodeAt(i)>256) return true;   
							}
							return false;
						}   
					 
					 function cateChange(selectObject){
						  if (selectObject==null) return ;
						   if (selectObject.selectedIndex<0) return;
							var selectOption=selectObject.options[selectObject.selectedIndex];
							if (selectOption.value==""){
							   for(var i=0;i<selectObject.options.length;i++){
							       if (selectObject.options[i].value=='0'){
								      selectObject.selectedIndex=i;
									  break;
								   }
							   }
							}
						}
						
						function tradeShowSearch(){
								var form = document.forms["SearchBarForm"];
								var oIndustrySelect = form.elements["srchIndustryIdx"];
								var oLocationSelect = form.elements["srchLocationIdx"];
								var oSearchText = form.elements["SearchTextIdx"];
								
								var industry = oIndustrySelect.options[oIndustrySelect.selectedIndex].value;
								form.elements["keywordIdx"].value = oSearchText.value;
								form.elements["locationIdx"].value = oLocationSelect.options[oLocationSelect.selectedIndex].value;				
								form.elements["industry"].value = industry;
						}
						
						function loadSearchItemsIdx(){
							var typeSel = get('IndexAreaOptionIdx');
							for(i=0;i<typeSel.length;i++){
								typeSel[i].selected=false;
							}
							typeSel[0].selected=true;
							searchTypeChange();
						}
						
						function isMatchTitle(val){
							return (val.match(/^Search (?:Products|Selling Leads|Suppliers|Buying Leads)$/) != null);
						}
						
						function defSearchText(e){
							if(isMatchTitle(this.value)){
								this.value = '';
							} else {
								YUE.removeListener(this, 'click', defSearchText);
							}
							YUD.setStyle(this, 'color', '#000');
						}
						
						function clearDfText(el){
							if(isMatchTitle(el.value)){
								el.value = '';
								YUD.setStyle(el, 'color', '#000');
							}
						}
						
						YUE.onDOMReady(function(){
							loadSearchItemsIdx();
							var oSearchText = get('SearchTextIdx');
							if(oSearchText.createTextRange){
								var rng = oSearchText.createTextRange();
								rng.collapse(true);
								rng.select();
							}else if(oSearchText.setSelectionRange){
								var rng = oSearchText.setSelectionRange(0,0)
							}
							oSearchText.focus();
							if(isMatchTitle(oSearchText.value)){return;}
							YUD.setStyle(oSearchText, 'color', '#000');
						});
						
						function searchTypeChange(){
							var oSelect1 = get("srchIndustryIdx");
							var oSelect2 = get("srchLocationIdx");
							var oSearchText = get("SearchTextIdx");
							var oCountrySel = get('refineSearchCountry_id');
							var oFormIndexArea = get("IndexAreaOptionIdx");
				    		if(!oFormIndexArea){ return; }
				    		var so = oFormIndexArea.options[oFormIndexArea.selectedIndex]
				    	    sv = so.value,
				    	    st = so.text;
							var isHome = "true";
								if(sv == 'ts_en'){
				    				oSelect1.style.display = '';
				    				oSelect2.style.display = '';
				    				oCountrySel.style.display = 'none';
				    				oSearchText.size = 30;
				    			}else{
				    				oSelect1.style.display = 'none';
				    				oSelect2.style.display = 'none';
				    				oCountrySel.style.display = '';
				    				if(trim(oSearchText.value) == '' || isMatchTitle(trim(oSearchText.value))){
				    					YUD.setStyle(oSearchText, 'color', '#939393');
				    					oSearchText.value = 'Search ' + ((st == 'Companies') ? 'Suppliers' : st);
				    					YUE.removeListener(oSearchText, 'click', defSearchText);
				    					YUE.on(oSearchText, 'click', defSearchText)
				    				}
				    				oSearchText.size = 55;
				    			}
						}
						
						function SelectCountry(obj){
						   //如果选中的是More,就跳转到AdvanceSearch页面
							  if(obj.value == "0"){
							    document.location = "http://www.alibaba.com/trade/advancesearch";
							    return;
							  }
					    }
							
						function printYearMonthListIdx(){
							var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
							var oSelect = get("srchYearMonthIdx");
							var now = new Date();
							var year = now.getFullYear();
							var month = now.getMonth();
							var idx = 1;
							for(i = month; i<12; i++, idx++){
								oOption = oSelect.options[idx];
								if(i == month){
									oOption.innerHTML = monthNames[i] + " >> " + year;
									oOption.value = year + "|" + (i + 1) ;
								}else{
									oOption.innerHTML = monthNames[i];
									oOption.value = year + "|" + (i + 1) ;	
								}
							}
							year += 1;
							for(i = 0; i<month; i++, idx++){
								oOption = oSelect.options[idx];
								if(i == 0){
									oOption.innerHTML = monthNames[i] + " >> " + year;
									oOption.value = year + "|" + (i + 1) ;
								}else{
									oOption.innerHTML = monthNames[i];
									oOption.value = year + "|" + (i + 1);
								}
							}
				
							return oSelect;
						}
						function changeSearchType(sType,obj){
							var typeSel = get('IndexAreaOptionIdx');
							for(i=0;i<4;i++){
								typeSel[i].selected=false;
							}
							var oLi=obj.parentNode.parentNode.getElementsByTagName('li');
							YUD.removeClass(oLi,"current")
							obj.parentNode.className="current";
							switch(sType){
								case("product"):{
									typeSel[0].selected=true;
									break;
									}
								case("buy"):{
									typeSel[1].selected=true;
									break;
									}
								case("sell"):{
									typeSel[2].selected=true;
									break;
									}
								case("company"):{
									typeSel[3].selected=true;
									break;
									}
								case("ts"):{
									typeSel[4].selected=true;
									break;
									}
								}
								searchTypeChange();
							}
				</script>
				<div class="aliSearch">
					<ul>
						<li class="current">
							<a href="javascript:void(0);" onclick="changeSearchType('product',this);">Products</a>
						</li>
						<li>
							<a href="javascript:void(0);" onclick="changeSearchType('sell',this);">Selling Leads</a>
						</li>
						<li>
							<a href="javascript:void(0);" onclick="changeSearchType('company',this);">Suppliers</a>
						</li>
						<li>
							<a href="javascript:void(0);" onclick="changeSearchType('buy',this);">Buyers</a>
						</li>
						<li>
							<a href="">Trade Shows</a>
						</li>					
						<li style="background: transparent none repeat scroll 0% 0% ! important; float: right; -moz-background-clip: -moz-initial ! important; -moz-background-origin: -moz-initial ! important; -moz-background-inline-policy: -moz-initial ! important;">
							<a href=""	style="padding: 9px 0px 5px 30px; background: transparent url(../images/jawashop/23x22_080710_sdicon.jpg) no-repeat scroll 0px 4px ! important; width: 120px; -moz-background-clip: -moz-initial ! important; -moz-background-origin: -moz-initial ! important; -moz-background-inline-policy: -moz-initial ! important;">
								<div style="font-size: 11px; font-weight: normal;">
									<u><strong>Find Your SuperDeals</strong></u>
								</div>
							</a>
						</li>
					</ul>
					<div class="searchBox">
						<form name="SearchForm" action="http://importer.alibaba.com/buyeroffers"
							method="get" onsubmit="return beforeSubmit(this);">
							<div>
							<input name="Type" value="BUY" type="hidden">
							<input	name="ssk" value="y" type="hidden">
							<input name="year" id="yearIdx" value="" type="hidden">
							<input name="month" id="monthIdx" value="" type="hidden">
							<input name="industry" id="industryIdx" value="" type="hidden">
							<input name="location" id="locationIdx" value="" type="hidden">
							<input name="keyword" id="keywordIdx" value="" type="hidden">
							<div style="padding-left: 53px;" class="intelligent">
								<input style="border: 1px solid rgb(65, 143, 180); padding: 3px; width: 454px; font-size: 13px; color: rgb(147, 147, 147);"
									id="SearchTextIdx" autocomplete="off" name="SearchText" size="55"
									value=" " onkeyup= requestEndFlag = true; inputTimeOut(event);;onkeydown=lnoKeyDown(event);clearDfText(this);
									type="text">
								
								<script language="javascript">
	                         	writeHiddenIFrame(0,0);
	                         	initIntelligentSearchBar();
								</script>
							</div>
							
						
						<script language="javascript">
							if (document.isBigerScreen) {
								try {
									get('SearchTextIdx').style.width = "350px";
								} catch (e) {
								}
							}
						</script>
						
						
						<div style="display: none;">
							<select name="IndexArea" id="IndexAreaOptionIdx" onchange="searchTypeChange();">
								<option value="product_en" selected="selected">Products</option>
								<option value="offer_en">Buying Leads</option>
								<option value="offer_en">Selling Leads</option>
								<option value="company_en">Companies</option>
								<option value="ts_en">Trade Shows</option>
							</select>
						</div>
						
						<script language="javascript">
							initSelectWithValue(document.SearchForm.IndexArea, "");
						</script>
						
						<script language="JavaScript">
							document.SearchForm.SearchText.value = XMLDecode(document.SearchForm.SearchText.value);;
						</script> 
						<script language="JavaScript">
							if (typeof (logKeywordsHistory) == 'function') {
								logKeywordsHistory(document.SearchForm.SearchText.value)
							};
						</script>

						<select name="Country" id="refineSearchCountry_id" onchange="SelectCountry(this)" style="width: 160px; font-size: 13px;" class="ts">
							<option value="">Select Country/Region</option>
							<option value="">Show all </option>
							<option value="CN">China (mainland)</option>
							<option value="IN">India</option> 
							<option value="US">United States</option>
							<option value="UK">United Kingdom</option>
							<option value="KR">South Korea</option>
							<option value="PK">Pakistan</option>
							<option value="HK">Hong Kong </option> 
							<option value="TR">Turkey</option>
							<option value="ID">Indonesia </option>
							<option value="TW">Taiwan</option> 
							<option value="DE">Germany</option>
							<option value="IT">Italy </option>
							<option value="MY">Malaysia</option>
							<option value="SG">Singapore</option>
							<option value="TH">Thailand</option>
							<option value="AE">United Arab Emirates</option> 
							<option value="0">More ...</option>
						</select>
						<select name="srchIndustry" id="srchIndustryIdx" style="display: none;" class="ts">
						</select> 
						<select name="srchLocation" id="srchLocationIdx" style="width: 10.6em; display: none;">
							<option value="YU">Yugoslavia</option>
							<option value="ZM">Zambia</option>
							<option value="ZW">Zimbabwe</option>
						</select>

					    <script language="javascript"> 
					     	if(document.isBigerScreen){
					     		try{
					     			get('SearchTextIdx').style.width="350px";
					     		}catch(e){}
					     		}
				     	</script>
		       
			   			<script language="javascript"> initSelectWithValue(document.SearchForm.IndexArea,"");</script>
						<input value="Search" class="buttonSkinA" style="margin: 0pt; padding: 1px 4px; width: 108px; height: 25px; font-family: arial; font-style: normal; font-variant: normal; font-weight: bold; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;" border="0" type="submit"> 
		   		  
		    		   <script language="JavaScript">
		    		   		document.SearchForm.SearchText.value = XMLDecode(document.SearchForm.SearchText.value);;
		    			</script>
		    			<script language="JavaScript">
							if(typeof(logKeywordsHistory) == 'function'){logKeywordsHistory(document.SearchForm.SearchText.value)};
						</script>
						&nbsp;&nbsp;<a href="" style="margin-left: 20px; font-size: 11px; text-decoration: underline;">More search options</a>
					
							</div>
						</form>					
					</div>					
				</div>
				<!-- aliSearch -->
				<div class="homePopSearch">
					<a href="" target="_blank" style="color: rgb(0, 0, 0); text-decoration: none;">
						<strong>Popular Searches:</strong>
					</a>
				
					<a href="">car mp3 player</a>, 
					<a href="">shoes</a>,
					<a href="l">cement</a>, 
				 	<a href="">handbags</a>, 
				 	<a href="">cell phones</a>, 
					 <a href="">fashion T-shirts</a>, 
					 <a href="">plywood</a>, 
					 <a href="">fabric</a>, 
					 <a href="">jewellery</a>, 
					 <a href="">ATV 250CC</a> 
				</div>
				
				
				<div class="colRL">
					<h1><decorator:title/></h1>
				    <%@ include file="/messages.jsp"%>
				    <decorator:body/>
				    <div id="underground"><decorator:getProperty property="page.underground"/></div>
				</div>
			
				
				<!--hz_aisn_web4 --> 
				<script type="text/javascript">
					YUE.on(window, 'load', function() {
						AE.webUser.writeWelcomeInfo('welcome_info');
						var headerUnread = new getMessageStatus();
						headerUnread.init();
					})
				</script>
			</div>
			<div id="footer">
				<strong> © JAWA-SHOP 1999-2008</strong>
				<a href="">JAWA-SHOP</a>	
			</div>
		</div>
	</body>
</html>
